//
//  ViewController.m
//  PanoramaTest
//
//  Created by Kim Myoung Il on 12. 2. 18..
//  Copyright (c) 2012년 __MyCompanyName__. All rights reserved.


#import "ViewController.h"

@implementation ViewController
@synthesize viewPanorama;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    if ([super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])
    {
    }
    
    return self;
}

- (void)dealloc
{
    [viewPanorama release];
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    // Panorama 초기 설정
    viewPanorama.delegate= self;

    // Panorama 이미지 적용
    [viewPanorama setBackgroundImageWithPath:[[NSBundle mainBundle] pathForResource:@"pano" ofType:@"jpg"]];

    // X축 설정
    [viewPanorama setYaw:0];
    
    // 스케일 설정
    [viewPanorama setScale:1];
}

- (void)viewDidUnload
{
    [self setViewPanorama:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

- (void)detectedTap:(UITapGestureRecognizer *)gestureRecognizer TKView:(TKPanoramaView *)panoramaView
{
    NSLog(@"detectedTap:%@ TKView:%@", gestureRecognizer, panoramaView);
}

- (void)detectedPan:(UIPanGestureRecognizer *)gestureRecognizer TKView:(TKPanoramaView *)panoramaView
{
    NSLog(@"detectedPan:%@ TKView:%@", gestureRecognizer, panoramaView);
}

- (void)detectedPinch:(UIPinchGestureRecognizer *)gestureRecognizer TKView:(TKPanoramaView *)panoramaView
{
    NSLog(@"detectedPinch:%@ TKView:%@", gestureRecognizer, panoramaView);
}

- (void)didDrawTKView:(TKPanoramaView *)panoramaView 
{
    NSLog(@"didDrawTKView:%@", panoramaView);
}

@end
